<meta charset="UTF-8">
<?php

include_once("../functions/db_manipulate.php");

if (!init()) {
    redirect("login.php");
}

$id = 0;
$guest = false;

if (isset($_GET['uid']) && $_GET['uid'] != $_SESSION['id']) {
    $id = $_GET['uid'];
    $guest = true;
} else {
    $id = $_SESSION['id'];
    $guest = false;
}

$usrSet = getStat($id);
$usrInfo = mysql_fetch_assoc($usrSet);

?>

<div class="commoninfodiv">
    <div class="sectionheader">
        Статистика:
    </div>
    <div class="infodiv">
        <div class="infodivtd">
            Ник:
        </div>
        <div class="infodivtd">
            <?= $usrInfo['nick'] ?>
        </div>
        <div class="infodivtd">
            Зарегистрирован:
        </div>
        <div class="infodivtd">
            <?= $usrInfo['registered'] ?>
        </div>
        <div class="infodivtd">
            E-mail:
        </div>
        <div class="infodivtd">
            <?= $usrInfo['email'] ?>
        </div>
        <div class="infodivtd">
            Сообщений:
        </div>
        <div class="infodivtd">
            <?= $usrInfo['messages'] ?>
        </div>
        <div class="infodivtd">
            Имя:
        </div>
        <div class="infodivtd">
            <?= $usrInfo['firstname'] ?>
        </div>
        <div class="infodivtd">
            Группы:
        </div>
        <div class="infodivtd">
            <div style="text-align: center; width: 100%">
                <?php
                do {
                    echo $usrInfo['groups'] . "<br>";
                } while ($usrInfo = mysql_fetch_assoc($usrSet))
                ?>
            </div>
        </div>
    </div>
</div>